<fieldset>

    <legend>条件搜索</legend>

    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">公司名称</label>
            <div class="layui-input-inline">
                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入公司名称" class="layui-input">
            </div>
        </div>

                <div class="layui-form-item layui-inline">
            <label class="layui-form-label">公司信用代码</label>
            <div class="layui-input-inline">
                <input name="code" value="{$Think.get.code|default=''}" placeholder="公司信用代码" class="layui-input">
            </div>
        </div>


                <div class="layui-form-item layui-inline">
            <label class="layui-form-label">公司法人</label>
            <div class="layui-input-inline">
                <input name="corporation" value="{$Think.get.corporation|default=''}" placeholder="公司法人" class="layui-input">
            </div>
        </div>

{if $userinfo['db1']['authorize']==0 || $userinfo['db1']['authorize']==1}
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">公司审核状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="status">
                    {foreach [''=>'-- 全部状态 --','2'=>'审核通过','1'=>'审核未通过'] as $k=>$v}
                    {eq name='Think.get.status' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        {/if}


           <div class="layui-form-item layui-inline">
           <label class="layui-form-label">添加时间</label>
           <div class="layui-input-inline">
       		  <input type="text" class="layui-input" id="create_at_first" name="create_at_first" value="{$Think.get.create_at_first|default=''}"  placeholder="请选择添加时间">			 
        <!--  <input data-date-range name="create_at" id="create_at" value="{$Think.get.create_at|default=''}" placeholder="请选择添加时间" class="layui-input"> -->
           </div>
         <div class="layui-form-mid">—</div>
       	   <div class="layui-input-inline">
       	<input type="text" class="layui-input" id="create_at_last" name="create_at_last" value="{$Think.get.create_at_last|default=''}"  placeholder="请选择添加时间">
       	</div>
       </div>
 <input type="hidden" name="true_spm" value="m-209-210-211">
        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
        </div>
    </form>

</fieldset>

<script>form.render()</script>
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //执行一个laydate实例
  laydate.render({
    elem: '#create_at_first' //指定元素
  });
   laydate.render({
    elem: '#create_at_last' //指定元素
  });
});
</script>
<script>
	$("#singcms-button-submit").click(function() {
	    var data = $("#singcms-form").serializeArray();
	    postData = {};
	    $(data).each(function(i) {
	        postData[this.name]= this.value;
	    });
		// postData['create_at']=create_at;
	    console.log(postData);
		
	    // 将获取到的数据post给服务器
	    url = SCOPE.save_url;
	    jump_url = SCOPE.jump_url;
	    $.post(url, postData, function(result) {
	        if (result.code == 200) {
	            //成功
	            return dialog.success(result.message, jump_url);
	        } else if (result.code == 400) {
	            // 失败
	            return dialog.error(result.message);
	        }
	    }, "JSON");
	});
	


</script>
<script>
		var SCOPE = {
		'save_url' : "{:url('user/user/index')}",
		'jump_url' : "{:url('user/user/index')}",
	
	};
</script>